Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

(WIP) Fixes #856 new homepage #943

Closed
wants to merge 21 commits into from

Conversation

mmmavis
Copy link
Member

@mmmavis mmmavis commented May 26, 2015

This fixes #856

[ WIP ]

@@ -4,3 +4,4 @@
@import "components/index";
@import "pages/index";
@import "../node_modules/react-select/less/default.less";
@import "../node_modules/react-select/less/default.less";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm why is the same file imported twice?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

purely by mistake 😁

@toolness
Copy link
Contributor

The new hero-unit.png and its 2x variant are 160k and 560k, respectively, which is quite large. Can you optimize the file sizes a bit?

imgSrc="/img/pages/clubs/mikko-finland.png" imgSrc2x="/img/pages/clubs/[email protected]" imgAlt="Mikko Finland Quote">

<p>The idea of teachers and students learning at the same time is what makes me excited about this work.</p>
<p>"The idea of teachers and students learning at the same time is what makes me excited about this work."</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be swell to use &ldquo; and &rdquo; for typographic awesomeness here but it's up to you 😁

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe using CSS pseudo-elements :before and :after could help? And I guess we don't have to pass imgAlt here as well since the image is decorative

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OR...
I wonder if we could use <q> to wrap around the actual quote instead of <p>. I tested it with VoiceOver and it interpreted the two(<q> vs <p>) the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh neat, I didn't even know <q> was a tag!

@toolness
Copy link
Contributor

Err, sorry I started reviewing this before you were finished--just figured I'd get a head start, but please let me know if my comments were unhelpful.

@mmmavis
Copy link
Member Author

mmmavis commented May 26, 2015

not a problem as all, and thanks for those suggestions and comments :bowtie:

@mmmavis
Copy link
Member Author

mmmavis commented May 26, 2015

it's better to know early whether or not i'm on the right track! 💃

@mmmavis mmmavis force-pushed the issue-856-new-homepage branch from c81060c to 280c772 Compare May 27, 2015 00:29
<div className="featured-post">
<div className="entry-posted-container">
<p className="entry-posted">
<time className="published" title={this.props.data.publishedDate} dateTime={this.props.data.publishedDate} >
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving dateTime value unparsed here since it's in machine readable format already

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time

This element is intended to be used presenting dates and times in a machine readable format. This can be helpful for user agents to offer any event scheduling for user's calendar.

#content {
padding-left: 0;
padding-right: 0;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, unfortunately this seems to break other pages. For instance, in /about/, the heading "About Mozilla Learning Networks" bleeds all the way to the very edge of the screen on mobile, whereas there's normally 15px of padding being applied from bootstrap's .col-* rules. 😢

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arghhh, if #content does have left/right padding we won't be able to have a full width section with background colour (e.g., the quote section on the new homepage). I probably have to go through all the pages and make sure things are being wrapped within extra inner containers... 😭

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, can you set negative margin to offset the padding? I actually did that with the hero unit for the original site, way back in February: https://github.com/mozilla/teach.webmaker.org/blob/8804e410ce96df5d2983fe829b6a81c335e94d74/styles.less#L23-L26

I'm not sure if that CSS has actually survived to present-day or not, hehe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, I tried the following on that full width coloured section

margin-left: -(@grid-gutter-width / 2);
padding-left: (@grid-gutter-width / 2);

This leaves a gap to the right due to the negative offset on the left.

Adding margin-right: -(@grid-gutter-width / 2); simply just makes the section wider but the gap is still there, which introduces a horizontal scrollbar to the page.

Also, this approach won't work on larger screen either as we can't specify how much offset we want to move. (see https://github.com/mmmavis/teach.webmaker.org/blob/develop/less/components/page.less#L21-L23)

😭

@toolness
Copy link
Contributor

Hmm, I guess don't actually worry about fixing any of the feed API stuff now. I should've seen this complexity coming and had us split this up into two separate PRs, one for the HTML/CSS of the page and the other for the feed stuff. It's way too much work for one person!

@toolness
Copy link
Contributor

I just noticed that the rightmost icon link actually looks a bit wonky when the page is narrow:

2015-05-27_17-09-41

@toolness
Copy link
Contributor

Ok I just filed mmmavis#3! If you accept that, then we can work in parallel and eventually UNITE.

@toolness
Copy link
Contributor

By the way, when I load your PR in Chrome, the following is logged to my browser console when viewing the fancy new homepage:

Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to moment/moment#1407 for more info.

@mmmavis
Copy link
Member Author

mmmavis commented May 28, 2015

oh darn I don't get why
screen shot 2015-05-27 at 6 05 05 pm the text didn't get wrappppppppped. Gonna come back to this issue tonight

@mmmavis
Copy link
Member Author

mmmavis commented May 28, 2015

Hey @toolness ,

As I investigated the margin issue I went through all the pages and wrapped sections within <section>. We have done that on some pages but it's just we haven't been consistent about it. If you wanna view the code changes you can add ?w=1 to the URL to hide all the whitespace differences in the PR. e.g., https://github.com/mozilla/teach.webmaker.org/pull/943/files?w=1

@@ -1,4 +1,5 @@
.btn {
white-space: normal;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button text should be wrapped. we shouldn't assume button text can always fit into one line, especially the site will be localized in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, do you think you can actually add that as a comment in the code?

@mmmavis
Copy link
Member Author

mmmavis commented May 28, 2015

@toolness unit test PR is here. Still WIP though but I had some questions for you there 💁

</section>
</div>
<section className="intro">
<h1>About Mozilla Learning Networks</h1>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, changes like this made this PR harder to understand, with all the other changes going on in it 😭

If it's still possible, do you think you can actually undo these kinds of changes that are purely indentation changes due to being wrapped in a new element? We could then redo the indentation fixes in a separate PR after the homepage lands... if it's too much trouble though, don't worry about it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait nevermind! I didn't see your note about ?w=1, that's 💥 AWESOME 💥

@mmmavis
Copy link
Member Author

mmmavis commented May 28, 2015

I opened a cleaner version of this PR and it got merged. Gonna close this one now.

@mmmavis mmmavis closed this May 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants